package leetcode_字符串._07数字与字符串间转换;

import java.util.ArrayList;
import java.util.List;

/**
 * Fizz Buzz
 */
public class _412 {

    public List<String> fizzBuzz(int n) {
        ArrayList<String> ans = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            boolean by3 = i % 3 == 0;
            boolean by5 = i % 5 == 0;
            String str = "";
            if (by3) {
                str += "Fizz";
            }
            if (by5) {
                str += "Buzz";
            }
            if (str.equals("")) {
                str += i;
            }
            ans.add(str);
        }
        return ans;
    }
}
